import Vue from 'vue'
import Router from 'vue-router'

Vue.use(Router)
const menu = ()=>import('../pages/menu/menu')
const index = ()=>import('../pages/index/index') 
const login = ()=>import('../pages/login/login')
const role = ()=>import('../pages/role/role')
const manager = () =>import('../pages/manager/manager')
const cate = ()=>import('../pages/cate/cate')
export default new Router({
  routes: [
    {
      path:'/login',
      component:login
    },{
      path:'*',
      redirect:'/login'
    },
    {
      path:'/index',
      component:index,
      name:'首页',
      children:[
        {
          path:'/menu',
          component:menu,
          name:'菜单管理'
        },
        {
          path:'/role',
          component:role,
          name:'角色管理'
        },
        {
          path:'/manager',
          component:manager,
          name:"管理员管理"
        },
        {
          path:'/cate',
          component:cate,
          name:'商品分类'
        }
      ]
    }
  ]
})
